package com.jeremy.listener;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jeremy.entity.User;
import com.jeremy.service.UserService;

@Component
public class InitListener
{
	@Autowired
	UserService service;
	
	@PostConstruct
	void initMethod()
	{
		System.out.println("================================@PostConstruct执行了================================");
		User user = service.findOne(1L);
		System.out.println(user);
	}

	public void afterPropertiesSet()
	{
		System.out.println("================================afterPropertiesSet执行了================================");
		User user = service.findOne(1L);
		System.out.println(user);
		
	}
}
